#include "main_framework.h"

uint32_t system_time_ms =0;
uint32_t system_time_count =0;

void task1_func()
{
    servo_scan();
}

void task2_func()
{
    
}

void task3_func()
{
    
}

void task4_func()
{	

}


TASK_COMPONENTS TaskComps[] = 
{
    {0, 1, 1,       task1_func},
    {0, 100, 100,   task2_func},
    {0, 5, 5,       task3_func},
    {0, 1000, 1000, task4_func},
    //add new tasks,pls  here
};

void task_remark(void)
{
    uint8_t count = 0;
    for (count=0; count<CALCULATE_LEN(TaskComps); count++)
    {
        TaskComps[count].Timer--;
        if (TaskComps[count].Timer == 0)
        {
            TaskComps[count].Timer = TaskComps[count].ItvTime;
            TaskComps[count].TaskHook();
        }
        systick_delay_ms(1);
    }
}

void main_framework_interface(void)
{
    // system_time_ms++;
    // if(system_time_ms%10==0)
    {
        task_remark();
    }
    // if(system_time_ms == 100)
    // {
    //     system_time_ms = 0;
    // }

}
